﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Ngram
{
    public partial class FormMain : Form
    {
        PProcess pp = new PProcess();
        public FormMain()
        {
            InitializeComponent();
            Data.AllowFilter = true;
            Data.ThresholdFilter = 5;
            Data.ThresholdNotFound = 0.0000001;
        }

        private void button1_Click(object sender, EventArgs e)
        {

            richTextBox2.Text = "m1 : " + pp.process(richTextBox1.Text, PProcess.NgramModel.TypeI) + "\n";
            richTextBox2.AppendText("m2 : " + pp.process(richTextBox1.Text, PProcess.NgramModel.TypeII) + "\n");
            richTextBox2.AppendText("m3 : " + pp.process(richTextBox1.Text, PProcess.NgramModel.TypeIII) + "\n");
            richTextBox2.AppendText("m4 : " + pp.process(richTextBox1.Text, PProcess.NgramModel.TypeIV) + "\n");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Console.WriteLine("Reading data...");
            Data.readData(textBox1.Text);
            Console.WriteLine("Read complete");
        }
    }
}
